package PTA_JAVA.JavaA.Javademo3;

import java.util.Locale;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextLine()){
            int a=Math.abs(sc.nextInt());
            String n = String.valueOf(a);
            if(Integer.parseInt(n)>=10000 && Integer.parseInt(n)<=20000){
                System.out.println(Integer.toString(Integer.parseInt(n),2)+","+Integer.toString(Integer.parseInt(n),8)+","+Integer.toString(Integer.parseInt(n),16));
            }else{
                int sum=0;
                for (int i = 0; i < n.length(); i++) {
                    System.out.print(n.substring(i,i+1)+" ");
                    sum+=Integer.parseInt(n.substring(i,i+1));
                }
                System.out.println(sum);
            }

        }
    }
}
